<?php 
/* 判断第几天
*/
header("Content-Type: text/html; charset=utf-8");
	$year = 2014;
	$month = 7;
	$day = 17;

	$time = 0;

	$nday = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 30, 31);
	if ((($year/4 == 0)&&($year/400 !== 0)) || ($year/400 == 0)) {
		for ($i=0; $i<($month-1); $i++) {
			$time += $nday[$i];
		}

		$time += $day;
		echo "这是该年的第".$time."天"; 

	} else {
		$nday[1] = 29;
		for ($i=0; $i<($month-1); $i++) {
			$time += $nday[$i];
		}

		$time += $day;

		echo "这是该年的第".$time."天"; 
	}
?>